package com.zbdx.dao;

import com.zbdx.domain.User;

import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    User findUserByUsernameAndPassword(String usernmae, String password) throws SQLException;
    boolean saveUser(User user) throws SQLException;

    boolean Exists(String username) throws SQLException;

    User findByUsername(String username) throws SQLException;
    int updateUserInfo(User user) throws SQLException;

    //修改---------------------------------------------------------------

    int insert(User user) throws SQLException;

    /**
     * 修改用户
     * @param user
     * @return
     */
    int update(User user) throws SQLException;

    /**
     * 根据ID删除用户信息
     * @param id
     * @return
     */
    int deleteById(int id) throws SQLException;

    int bathDeleteUser(List<Integer> ids) throws SQLException;
    /**
     * 根据ID查询
     */
    User selectById(int id) throws SQLException;

    /**
     * 查询所有
     * @return
     */
    List<User> selectAll() throws SQLException;
    List<User> selectBySearch(String name) throws SQLException;

}
